package com.yao.propertis;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "yao.jwt")
@Data
public class JwtProperties {

    /**
     * 管理端员工生成jwt令牌相关配置
     */
    public static String secretKey;// jwt密钥
    public static long ttl;// jwt有效期
    public static String tokenName;// jwt token名称

    /**
     * 用户端微信用户生成jwt令牌相关配置
     */
    private String userSecretKey;
    private long userTtl;
    private String userTokenName;


    public JwtProperties() {
    }

    public JwtProperties(String secretKey, long ttl, String tokenName, String userSecretKey, long userTtl, String userTokenName) {
        this.secretKey = secretKey;
        this.ttl = ttl;
        this.tokenName = tokenName;
        this.userSecretKey = userSecretKey;
        this.userTtl = userTtl;
        this.userTokenName = userTokenName;
    }

    /**
     * 获取
     * @return secretKey
     */
    public String getSecretKey() {
        return secretKey;
    }

    /**
     * 设置
     * @param secretKey
     */
    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    /**
     * 获取
     * @return ttl
     */
    public long getTtl() {
        return ttl;
    }

    /**
     * 设置
     * @param ttl
     */
    public void setTtl(long ttl) {
        this.ttl = ttl;
    }

    /**
     * 获取
     * @return tokenName
     */
    public String getTokenName() {
        return tokenName;
    }

    /**
     * 设置
     * @param tokenName
     */
    public void setTokenName(String tokenName) {
        this.tokenName = tokenName;
    }

    /**
     * 获取
     * @return userSecretKey
     */
    public String getUserSecretKey() {
        return userSecretKey;
    }

    /**
     * 设置
     * @param userSecretKey
     */
    public void setUserSecretKey(String userSecretKey) {
        this.userSecretKey = userSecretKey;
    }

    /**
     * 获取
     * @return userTtl
     */
    public long getUserTtl() {
        return userTtl;
    }

    /**
     * 设置
     * @param userTtl
     */
    public void setUserTtl(long userTtl) {
        this.userTtl = userTtl;
    }

    /**
     * 获取
     * @return userTokenName
     */
    public String getUserTokenName() {
        return userTokenName;
    }

    /**
     * 设置
     * @param userTokenName
     */
    public void setUserTokenName(String userTokenName) {
        this.userTokenName = userTokenName;
    }

    public String toString() {
        return "JwtProperties{secretKey = " + secretKey + ", ttl = " + ttl + ", tokenName = " + tokenName + ", userSecretKey = " + userSecretKey + ", userTtl = " + userTtl + ", userTokenName = " + userTokenName + "}";
    }
}